package com.railway.switchs.utils;

import com.railway.switchs.enums.EnumRoleType;

/**
 * @ClassName CreateAccountUtil
 * @Author 魏梓晟
 * @Version 1.0
 **/
public class CreateAccountUtil {

    private final static int RANDOM_LEN = 3;

    /**
     * 生成系统用户账号
     * 生成规则：用户类型+随机数+时间戳
     * @param userType
     * @return
     */
    public static String createUserAccount(String userType){

        return userType + StringUtil.getRandomStr(RANDOM_LEN) + DateUtil.getCurrentDateTime();
    }

    public static void main(String[] args) {
        System.out.println(createUserAccount(EnumRoleType.ADMINISTRATORS.getCode()));
    }
}
